# make-all-renderlists.sh script
# (c) nabster http://code.google.com/p/cinelerra-scripts
# distribute under GPL

#
for files in `ls -1 *.xml | awk  -vpath=$PWD/ '{print path$1}'`
# ------------->
do
filenamewithoutextension=${files%.xml}
echo ./make-renderlist.sh $filenamewithoutextension

# Remove old file if exists
rm -v $filenamewithoutextension.renderlist

# Write the file
echo "<?xml version=\"1.0\"?>
<JOB EDL_PATH=\"$filenamewithoutextension.xml\" STRATEGY=\"0\" ENABLED=\"1\" ELAPSED=\"0\">
<ASSET SRC=\"$filenamewithoutextension.wav\">
<FOLDER>Media</FOLDER>
<FORMAT TYPE=\"Microsoft WAV\" USE_HEADER=\"1\"></FORMAT>
<AUDIO CHANNELS=\"0\" RATE=\"0\" BITS=\"16\" BYTE_ORDER=\"1\" SIGNED=\"1\" HEADER=\"0\" DITHER=\"0\" ACODEC=\"twos\" AUDIO_LENGTH=\"0\"></AUDIO>
<VIDEO_OMIT HEIGHT=\"0\" WIDTH=\"0\" LAYERS=\"0\" FRAMERATE=\"0\" VCODEC=\"yuv2\" VIDEO_LENGTH=\"0\" INTERLACE_AUTOFIX=\"1\" INTERLACE_MODE=\"UNKNOWN\" INTERLACE_FIXMETHOD=\"SHIFT_UPONE\" REEL_NAME=\"cin0000\" REEL_NUMBER=\"0\" TCSTART=\"0\" TCEND=\"0\" TCFORMAT=\"0\"></VIDEO_OMIT>
</ASSET>
PATH $filenamewithoutextension.wav
AUDIO_CODEC twos
VIDEO_CODEC yuv2
AMPEG_BITRATE 320
AMPEG_DERIVATIVE 3
VORBIS_VBR 0
VORBIS_MIN_BITRATE -1
VORBIS_BITRATE 128000
VORBIS_MAX_BITRATE -1
THEORA_FIX_BITRATE 1
THEORA_BITRATE 860000
THEORA_QUALITY 16
THEORA_SHARPNESS 2
THEORA_KEYFRAME_FREQUENCY 64
THEORA_FORCE_KEYFRAME_FEQUENCY 64
MP3_BITRATE 256000
MP4A_BITRATE 256000
MP4A_QUANTQUAL 100
JPEG_QUALITY 100
ASPECT_RATIO -1.0000000000000000e+00
VMPEG_IFRAME_DISTANCE 45
VMPEG_PFRAME_DISTANCE 0
VMPEG_PROGRESSIVE 0
VMPEG_DENOISE 1
VMPEG_BITRATE 1000000
VMPEG_DERIVATIVE 1
VMPEG_QUANTIZATION 15
VMPEG_CMODEL 0
VMPEG_FIX_BITRATE 0
VMPEG_SEQ_CODES 0
VMPEG_PRESET 0
VMPEG_FIELD_ORDER 0
H264_BITRATE 2000000
H264_QUANTIZER 5
H264_FIX_BITRATE 0
DIVX_BITRATE 2000000
DIVX_RC_PERIOD 50
DIVX_RC_REACTION_RATIO 45
DIVX_RC_REACTION_PERIOD 10
DIVX_MAX_KEY_INTERVAL 250
DIVX_MAX_QUANTIZER 31
DIVX_MIN_QUANTIZER 1
DIVX_QUANTIZER 5
DIVX_QUALITY 5
DIVX_FIX_BITRATE 1
DIVX_USE_DEBLOCKING 1
MS_BITRATE 1000000
MS_BITRATE_TOLERANCE 500000
MS_INTERLACED 0
MS_QUANTIZATION 10
MS_GOP_SIZE 45
MS_FIX_BITRATE 1
AC3_BITRATE 640
PNG_USE_ALPHA 0
EXR_USE_ALPHA 0
EXR_COMPRESSION 0
TIFF_CMODEL 0
TIFF_COMPRESSION 0
FORMAT_YUV_USE_PIPE 0
FORMAT_YUV_PIPE 
REEL_NAME cin0000
REEL_NUMBER 0
TCSTART 0
TCEND 0
TCFORMAT 0
</JOB>
<JOB EDL_PATH=\"$filenamewithoutextension.xml\" STRATEGY=\"0\" ENABLED=\"1\" ELAPSED=\"0\">
<ASSET SRC=\"$filenamewithoutextension.ac3\">
<FOLDER>Media</FOLDER>
<FORMAT TYPE=\"AC3\" USE_HEADER=\"1\"></FORMAT>
<AUDIO CHANNELS=\"0\" RATE=\"0\" BITS=\"16\" BYTE_ORDER=\"1\" SIGNED=\"1\" HEADER=\"0\" DITHER=\"0\" ACODEC=\"twos\" AUDIO_LENGTH=\"0\"></AUDIO>
<VIDEO_OMIT HEIGHT=\"0\" WIDTH=\"0\" LAYERS=\"0\" FRAMERATE=\"0\" VCODEC=\"yuv2\" VIDEO_LENGTH=\"0\" INTERLACE_AUTOFIX=\"1\" INTERLACE_MODE=\"UNKNOWN\" INTERLACE_FIXMETHOD=\"SHIFT_UPONE\" REEL_NAME=\"cin0000\" REEL_NUMBER=\"0\" TCSTART=\"0\" TCEND=\"0\" TCFORMAT=\"0\"></VIDEO_OMIT>
</ASSET>
PATH $filenamewithoutextension.ac3
AUDIO_CODEC twos
VIDEO_CODEC yuv2
AMPEG_BITRATE 320
AMPEG_DERIVATIVE 3
VORBIS_VBR 0
VORBIS_MIN_BITRATE -1
VORBIS_BITRATE 128000
VORBIS_MAX_BITRATE -1
THEORA_FIX_BITRATE 1
THEORA_BITRATE 860000
THEORA_QUALITY 16
THEORA_SHARPNESS 2
THEORA_KEYFRAME_FREQUENCY 64
THEORA_FORCE_KEYFRAME_FEQUENCY 64
MP3_BITRATE 256000
MP4A_BITRATE 256000
MP4A_QUANTQUAL 100
JPEG_QUALITY 100
ASPECT_RATIO -1.0000000000000000e+00
VMPEG_IFRAME_DISTANCE 45
VMPEG_PFRAME_DISTANCE 0
VMPEG_PROGRESSIVE 0
VMPEG_DENOISE 1
VMPEG_BITRATE 1000000
VMPEG_DERIVATIVE 1
VMPEG_QUANTIZATION 15
VMPEG_CMODEL 0
VMPEG_FIX_BITRATE 0
VMPEG_SEQ_CODES 0
VMPEG_PRESET 0
VMPEG_FIELD_ORDER 0
H264_BITRATE 2000000
H264_QUANTIZER 5
H264_FIX_BITRATE 0
DIVX_BITRATE 2000000
DIVX_RC_PERIOD 50
DIVX_RC_REACTION_RATIO 45
DIVX_RC_REACTION_PERIOD 10
DIVX_MAX_KEY_INTERVAL 250
DIVX_MAX_QUANTIZER 31
DIVX_MIN_QUANTIZER 1
DIVX_QUANTIZER 5
DIVX_QUALITY 5
DIVX_FIX_BITRATE 1
DIVX_USE_DEBLOCKING 1
MS_BITRATE 1000000
MS_BITRATE_TOLERANCE 500000
MS_INTERLACED 0
MS_QUANTIZATION 10
MS_GOP_SIZE 45
MS_FIX_BITRATE 1
AC3_BITRATE 640
PNG_USE_ALPHA 0
EXR_USE_ALPHA 0
EXR_COMPRESSION 0
TIFF_CMODEL 0
TIFF_COMPRESSION 0
FORMAT_YUV_USE_PIPE 0
FORMAT_YUV_PIPE 
REEL_NAME cin0000
REEL_NUMBER 0
TCSTART 0
TCEND 0
TCFORMAT 0
</JOB>
<JOB EDL_PATH=\"$filenamewithoutextension.xml\" STRATEGY=\"0\" ENABLED=\"1\" ELAPSED=\"0\">
<ASSET SRC=\"$filenamewithoutextension.mp3\">
<FOLDER>Media</FOLDER>
<FORMAT TYPE=\"MPEG Audio\" USE_HEADER=\"1\"></FORMAT>
<AUDIO CHANNELS=\"0\" RATE=\"0\" BITS=\"16\" BYTE_ORDER=\"1\" SIGNED=\"1\" HEADER=\"0\" DITHER=\"0\" ACODEC=\"twos\" AUDIO_LENGTH=\"0\"></AUDIO>
<VIDEO_OMIT HEIGHT=\"0\" WIDTH=\"0\" LAYERS=\"0\" FRAMERATE=\"0\" VCODEC=\"yuv2\" VIDEO_LENGTH=\"0\" INTERLACE_AUTOFIX=\"1\" INTERLACE_MODE=\"UNKNOWN\" INTERLACE_FIXMETHOD=\"SHIFT_UPONE\" REEL_NAME=\"cin0000\" REEL_NUMBER=\"0\" TCSTART=\"0\" TCEND=\"0\" TCFORMAT=\"0\"></VIDEO_OMIT>
</ASSET>
PATH $filenamewithoutextension.mp3
AUDIO_CODEC twos
VIDEO_CODEC yuv2
AMPEG_BITRATE 320
AMPEG_DERIVATIVE 3
VORBIS_VBR 0
VORBIS_MIN_BITRATE -1
VORBIS_BITRATE 128000
VORBIS_MAX_BITRATE -1
THEORA_FIX_BITRATE 1
THEORA_BITRATE 860000
THEORA_QUALITY 16
THEORA_SHARPNESS 2
THEORA_KEYFRAME_FREQUENCY 64
THEORA_FORCE_KEYFRAME_FEQUENCY 64
MP3_BITRATE 256000
MP4A_BITRATE 256000
MP4A_QUANTQUAL 100
JPEG_QUALITY 100
ASPECT_RATIO -1.0000000000000000e+00
VMPEG_IFRAME_DISTANCE 45
VMPEG_PFRAME_DISTANCE 0
VMPEG_PROGRESSIVE 0
VMPEG_DENOISE 1
VMPEG_BITRATE 1000000
VMPEG_DERIVATIVE 1
VMPEG_QUANTIZATION 15
VMPEG_CMODEL 0
VMPEG_FIX_BITRATE 0
VMPEG_SEQ_CODES 0
VMPEG_PRESET 0
VMPEG_FIELD_ORDER 0
H264_BITRATE 2000000
H264_QUANTIZER 5
H264_FIX_BITRATE 0
DIVX_BITRATE 2000000
DIVX_RC_PERIOD 50
DIVX_RC_REACTION_RATIO 45
DIVX_RC_REACTION_PERIOD 10
DIVX_MAX_KEY_INTERVAL 250
DIVX_MAX_QUANTIZER 31
DIVX_MIN_QUANTIZER 1
DIVX_QUANTIZER 5
DIVX_QUALITY 5
DIVX_FIX_BITRATE 1
DIVX_USE_DEBLOCKING 1
MS_BITRATE 1000000
MS_BITRATE_TOLERANCE 500000
MS_INTERLACED 0
MS_QUANTIZATION 10
MS_GOP_SIZE 45
MS_FIX_BITRATE 1
AC3_BITRATE 640
PNG_USE_ALPHA 0
EXR_USE_ALPHA 0
EXR_COMPRESSION 0
TIFF_CMODEL 0
TIFF_COMPRESSION 0
FORMAT_YUV_USE_PIPE 0
FORMAT_YUV_PIPE 
REEL_NAME cin0000
REEL_NUMBER 0
TCSTART 0
TCEND 0
TCFORMAT 0
</JOB>
<JOB EDL_PATH=\"$filenamewithoutextension.xml\" STRATEGY=\"0\" ENABLED=\"1\" ELAPSED=\"0\">
<ASSET SRC=\"$filenamewithoutextension.mov\">
<FOLDER>Media</FOLDER>
<FORMAT TYPE=\"Quicktime for Linux\" USE_HEADER=\"1\"></FORMAT>
<AUDIO_OMIT CHANNELS=\"0\" RATE=\"0\" BITS=\"16\" BYTE_ORDER=\"1\" SIGNED=\"1\" HEADER=\"0\" DITHER=\"0\" ACODEC=\"twos\" AUDIO_LENGTH=\"0\"></AUDIO_OMIT>
<VIDEO HEIGHT=\"0\" WIDTH=\"0\" LAYERS=\"0\" FRAMERATE=\"0\" VCODEC=\"raw \" VIDEO_LENGTH=\"0\" INTERLACE_AUTOFIX=\"1\" INTERLACE_MODE=\"UNKNOWN\" INTERLACE_FIXMETHOD=\"SHIFT_UPONE\" REEL_NAME=\"cin0000\" REEL_NUMBER=\"0\" TCSTART=\"0\" TCEND=\"0\" TCFORMAT=\"0\"></VIDEO>
</ASSET>
PATH $filenamewithoutextension.mov
AUDIO_CODEC twos
VIDEO_CODEC raw 
AMPEG_BITRATE 320
AMPEG_DERIVATIVE 3
VORBIS_VBR 0
VORBIS_MIN_BITRATE -1
VORBIS_BITRATE 128000
VORBIS_MAX_BITRATE -1
THEORA_FIX_BITRATE 1
THEORA_BITRATE 860000
THEORA_QUALITY 16
THEORA_SHARPNESS 2
THEORA_KEYFRAME_FREQUENCY 64
THEORA_FORCE_KEYFRAME_FEQUENCY 64
MP3_BITRATE 256000
MP4A_BITRATE 256000
MP4A_QUANTQUAL 100
JPEG_QUALITY 100
ASPECT_RATIO -1.0000000000000000e+00
VMPEG_IFRAME_DISTANCE 45
VMPEG_PFRAME_DISTANCE 0
VMPEG_PROGRESSIVE 0
VMPEG_DENOISE 1
VMPEG_BITRATE 1000000
VMPEG_DERIVATIVE 1
VMPEG_QUANTIZATION 15
VMPEG_CMODEL 0
VMPEG_FIX_BITRATE 0
VMPEG_SEQ_CODES 0
VMPEG_PRESET 0
VMPEG_FIELD_ORDER 0
H264_BITRATE 2000000
H264_QUANTIZER 5
H264_FIX_BITRATE 0
DIVX_BITRATE 2000000
DIVX_RC_PERIOD 50
DIVX_RC_REACTION_RATIO 45
DIVX_RC_REACTION_PERIOD 10
DIVX_MAX_KEY_INTERVAL 250
DIVX_MAX_QUANTIZER 31
DIVX_MIN_QUANTIZER 1
DIVX_QUANTIZER 5
DIVX_QUALITY 5
DIVX_FIX_BITRATE 1
DIVX_USE_DEBLOCKING 1
MS_BITRATE 1000000
MS_BITRATE_TOLERANCE 500000
MS_INTERLACED 0
MS_QUANTIZATION 10
MS_GOP_SIZE 45
MS_FIX_BITRATE 1
AC3_BITRATE 640
PNG_USE_ALPHA 0
EXR_USE_ALPHA 0
EXR_COMPRESSION 0
TIFF_CMODEL 0
TIFF_COMPRESSION 0
FORMAT_YUV_USE_PIPE 0
FORMAT_YUV_PIPE 
REEL_NAME cin0000
REEL_NUMBER 0
TCSTART 0
TCEND 0
TCFORMAT 0
</JOB>"  >>$filenamewithoutextension.renderlist

done
# <-----------------------
